﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace 文件浏览
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            for (int i = 0; i <10; i++)
            {
                    ListBox1.Items.Add(i.ToString());
                
            }
            Label1.Text = ListBox1.SelectedIndex.ToString();
        }

        protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Label1.Text =  ListBox1.SelectedItem.Text;
        }
    }
}